package myservice.android.utilities;

import myservice.android.activities.BaseSaveableActivity;
import android.widget.CompoundButton;

/**
 * Listener for all CheckBox views that sets the activity as unsaved when the check box is selected or unselected.
 */
public class CheckBoxMonitor implements CompoundButton.OnCheckedChangeListener {
	
	private BaseSaveableActivity activity;
	
	public CheckBoxMonitor(BaseSaveableActivity activity) {
		this.activity = activity;
	}

	@Override
	public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
		activity.activityContentModified = true;		
	}

}
